/* @update: 2017-8-2 16:55:55 */
function getWeixinImage2() {
  getWeixinImage(function (e) {
    0 == e.successCode ? (
        $(".j_weixiRetry").hide(),
            $("#weixinImageURL").attr("src", e.weixinImageURL),

            setInterval(function () {
          queryOrderState(e.successUrl)
        }, 3e3),
            $(".j_weixinInfo").html("\u8ddd\u79bb\u4e8c\u7ef4\u7801\u8fc7\u671f\u8fd8\u5269<span class='j_qrCodeCountdown font-bold font-red'>45</span>\u79d2\uff0c\u8fc7\u671f\u540e\u8bf7\u5237\u65b0\u9875\u9762\u91cd\u65b0\u83b7\u53d6\u4e8c\u7ef4\u7801\u3002").removeClass("font-red"),
            paymentUI.setAuthCountdown(".j_qrCodeCountdown", 45, function () {
          $(".j_weixinInfo").html('\u4e8c\u7ef4\u7801\u5df2\u8fc7\u671f\uff0c<a href="javascript:getWeixinImage2();">\u5237\u65b0</a>\u9875\u9762\u91cd\u65b0\u83b7\u53d6\u4e8c\u7ef4\u7801\u3002').addClass("font-red"),
              $("#weixinImageURL").attr("src", "//img30.360buyimg.com/jr_image/jfs/t2893/157/4205885241/62385/951af5d5/57b51ea9Nb862ca5e.png")
        })) : $(".j_weixiRetry").show()
  })
}
function queryOrderState(e) {
  $.ajax({
    type: "GET",
    url: "/async/queryOrderState",
    data: {paySign: globalVar.paySign},
    dataType: "json",
    timeout: 4e3,
    async: !1,
    success: function (a) {
      1 == a.state && (window.location.href = e)
    }
  })
}
var getWeixinImage = function (e) {
  $.ajax({
    type: "get",
    url: "/weixin/getWeixinImageURL",
    dataType: "json",
    contentType: "application/json",
    data: {orderId: globalVar.orderId, paySign: globalVar.paySign},
    timeout: 25e3,
    success: function (a) {
      void 0 !== a && e(a)
    }
  })
};